﻿#define _CRT_SECURE_NO_WARNINGS 1
//#include <fstream>
//#include <iostream>
//#include <string>
//#include <sstream>
//#include<vector>
//#include<algorithm>
//using namespace std;

#include<stdio.h>
struct T 
{
	int a;
	float b;
	char c[20];
}t1;

struct 
{
	int a;
	float b;
	char c;

}* p;

struct 
{
	int a;
	float b;
	char c;
}x;

struct Stu
{
	char name[20];//名字
	int age;//年龄
	char sex[5];//性别
	char id[20];//学号
};
int main()
{
     

	//按照成员的顺序进行初始化
	struct Stu s1 = { "张三",12,"男","1101" };
	//按照指定的顺序初始化
	struct Stu s2 = { .age = 18, .name = "lisi", .id = "20230818002", .sex ="女" };
	printf("学生1的姓名为：%s\n", s1.name);
	printf("学生1的年龄为：%d\n", s1.age);
	printf("学生1的性别为：%s\n", s1.sex);
	printf("学生1的学号为：%s\n", s1.id);

	printf("学生2的姓名为：%s\n", s2.name);
	printf("学生2的年龄为：%d\n", s2.age);
	printf("学生2的性别为：%s\n", s2.sex);
	printf("学生2的学号为：%s\n", s2.id);
	return 0;
}